package chapter_3;

public class Test18 {
    public static void main(String[] args) {
        String word = "今天学习,      ";
        word = word.trim();
        String s = word.concat("Java语言!");//今天学习,Java语言!
        int index1 = s.indexOf(',');
        int index2 = s.indexOf('!');
        System.out.println(s.substring(index1+1 , index2));//Java语言
    }
}
